using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Summary description for VisaCard
/// </summary>
public class VisaCard
{
    public VisaCard() { }

    public static bool CheckExists(byte[] code)
    {
        SqlCommand cmd = DbProvider.CreateCommand("sp_VisaCardExists");

        cmd.Parameters.Add("@Code", SqlDbType.VarBinary);
        cmd.Parameters.Add("@rs", SqlDbType.Bit).Direction = ParameterDirection.Output;

        cmd.Parameters["@Code"].Value = code;
        DbProvider.ExecCmd(cmd);
        bool rs = (bool)cmd.Parameters["@rs"].Value;
        return rs;
    }

    public static bool CheckExpired(byte[] code)
    {
        SqlCommand cmd = DbProvider.CreateCommand("sp_VisaCardExpired");

        cmd.Parameters.Add("@Code", SqlDbType.VarBinary);
        cmd.Parameters.Add("@rs", SqlDbType.Bit).Direction = ParameterDirection.Output;

        cmd.Parameters["@Code"].Value = code;
        DbProvider.ExecCmd(cmd);
        bool rs = (bool)cmd.Parameters["@rs"].Value;
        return rs;
    }
}
